home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlComboSetDroppedWidth.au3 < prev    next >
Text File  |  2007-09-08  |  983b  |  33 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. Opt('MustDeclareVars',1)
  5.  
  6. Dim $Label,$Input,$Btn_Set,$Combo,$Btn_Exit,$msg,$ret
  7.  
  8. GuiCreate("ComboBox Set Dropped Width", 392, 254)
  9.  
  10. $Label = GuiCtrlCreateLabel("Enter New Width", 20, 20, 100, 20)
  11. $Input = GuiCtrlCreateInput("", 160, 20, 180, 20,$ES_NUMBER)
  12. GUICtrlSetLimit($Input,3)
  13. $Btn_Set = GuiCtrlCreateButton("Set Width", 160, 50, 90, 30)
  14. $Combo = GuiCtrlCreateCombo("", 70, 100, 50, 120)
  15. GUICtrlSetData($Combo,"AutoIt|v3|is|freeware|BASIC-like|scripting|language")
  16. $Btn_Exit = GuiCtrlCreateButton("Exit", 150, 200, 90, 30)
  17. GuiSetState()
  18. While 1
  19.     $msg = GuiGetMsg()
  20.     Select
  21.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  22.             ExitLoop
  23.         Case $msg = $Btn_Set
  24.             If(StringLen(GUICtrlRead($Input)) > 0) Then
  25.                 $ret = _GUICtrlComboSetDroppedWidth($Combo,Int(GUICtrlRead($Input)))
  26.                 If($ret == $CB_ERR) Then
  27.                     MsgBox(0,"Error","Couldn't set width")
  28.                 EndIf
  29.             EndIf
  30.     EndSelect
  31. WEnd
  32. Exit
  33.